package cn.wh.mybatis.mapping;

import cn.wh.mybatis.session.Configuration;
import cn.wh.mybatis.type.JdbcType;

/**
 * @Description 参数映射 #{property,javaType=int,jdbcType=NUMERIC}
 * @Version 1.0.0
 * @Date 2022/12/8 16:51
 * @Created wh
 */
public class ParameterMapping {

    private Configuration configuration;


    private String property;

    private Class<?>javaType=Object.class;

    private JdbcType jdbcType;


    public ParameterMapping(){

    }

    public static class Builder{

        private ParameterMapping parameterMapping = new ParameterMapping();

        public Builder (Configuration configuration, String property) {
            parameterMapping.configuration = configuration;
            parameterMapping.property = property;
        }

        public Builder javaType(Class<?> javaType) {
            parameterMapping.javaType = javaType;
            return this;
        }

        public Builder jdbcType(JdbcType jdbcType) {
            parameterMapping.jdbcType = jdbcType;
            return this;
        }



    }

    public Configuration getConfiguration() {
        return configuration;
    }

    public String getProperty() {
        return property;
    }

    public Class<?> getJavaType() {
        return javaType;
    }

    public JdbcType getJdbcType() {
        return jdbcType;
    }
}
